import React,{Component} from 'react';
import Untils from '../untils/untils'
import {connect} from 'react-redux'
class SignName extends Component{
    constructor(props){
        super(props)
    }
    render(){
        return(
            <div className='sign-page' ref='signName'></div>
        )
    }

    componentDidMount(){
        Untils.loadAsycJs('JQ','/jquery.min.js',()=>{
            let {$}=window;
           Untils.loadAsycJs('SIGN','/jSignature.min.noconflict.js',()=>{
              $(this.refs.signName).jSignature('init', {
                   height: '100%',
                   width: '100%',
                   color: "#000",
                   lineWidth: 2,
                   backgroundColor: '#f1f1f1'
               });
           })

        })
    }
    componentWillMount(){
        this.props.sendStatus()
    }
}

const mapDispatchToProps = dispatch => ({
    sendStatus: message => {
        dispatch({type: 'HIDE_HEAD'});
        dispatch({type: 'SHOW_FOOT'});
    },
});

export default connect(
    null,
    mapDispatchToProps
)(SignName)